class SimulationBodiesParametersForeignKeys < ActiveRecord::Migration
  def self.up
  	execute "ALTER TABLE simulation_bodies ADD CONSTRAINT fk_simulation_bodies_simulations 
  					FOREIGN KEY (simulation_id) REFERENCES simulations(id) ON DELETE CASCADE"
  	execute "ALTER TABLE simulation_bodies ADD CONSTRAINT fk_simulation_bodies_body_types
  					FOREIGN KEY (body_type_id) REFERENCES body_types(id)"
  end

  def self.down
  	execute "ALTER TABLE simulation_bodies DROP CONSTRAINT fk_simulation_bodies_simulations"
  	execute "ALTER TABLE simulation_bodies DROP CONSTRAINT fk_simulation_bodies_body_types"
  end
end
